package com.wyd.studentboot.serviceImpl;

import com.wyd.studentboot.bean.StudentBean;
import com.wyd.studentboot.bean.UserBean;
import com.wyd.studentboot.mapper.StudentMapper;
import com.wyd.studentboot.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class StudentServiceImpl implements StudentService {
    @Autowired
    private StudentMapper studentMapper;

    @Override
    public StudentBean queryStudentById(String id) {
        return studentMapper.selectStudentById(id);
    }

    @Override
    public int addStudent(StudentBean studentBean) {
        int aFlag = studentMapper.insertStudent(studentBean);
        return aFlag;
    }

    @Override
    public int dropStudent(String id) {
        int dFlag = studentMapper.deleteStudent(id);
        return dFlag;
    }

    @Override
    public int modifyStudent(StudentBean studentBean) {
        int mFlag = studentMapper.updateStudent(studentBean);
        return mFlag;
    }

    @Override
    public List<StudentBean> queryAllStudent() {
        return studentMapper.getAllStudent();
    }

    @Override
    public List<StudentBean> findName(String student_name){
        return studentMapper.findName(student_name);
    }
}
